// 账户明细界面
import { client } from '../../request/index.js'
Page({
  data: {
    imgIp: getApp().globalData.imgIp,
    gCoin: '',
    aCoin: '',
  },

  onLoad: function (options) {
    this.userInformation()
  },
  //查看记录
  accountList: function () {
    wx.navigateTo({
      url: '../account/clock_rec/clock_rec',
    })
  },
  //充值页面
  recharge: function () {
    wx.navigateTo({
      url: '../account/recharge/recharge',
    })
  },
  //兑换爱币
  exchange: function () {
    wx.navigateTo({
      url: '../account/exchange/exchange',
    })
  },
  //用户信息
  async userInformation() {
    const sessId = getApp().globalData.sessionid
    const getData = await client({
      url: '/account/detail',
    })
    console.log('用户信息', getData)
    this.setData({
      aCoin: getData.data.data.aCoin,
      gCoin: getData.data.data.gCoin,
      userId: getData.data.data.userId,
    })
  },

  onShareAppMessage: function () {},
})
